/*
  Copyright (c) 2025, Ventana Micro Systems Inc. All rights reserved.<BR>

  SPDX-License-Identifier: BSD-2-Clause-Patent

 */

#include <Library/RiscVPlatformSecLib.h>
#include <Register/RiscV64/RiscVImpl.h>

ASM_FUNC (_ModuleEntryPoint)
/* Use Temp memory as the stack for calling to C code */
li    a2, FixedPcdGet64 (PcdTemporaryRamBase64)
li    a3, FixedPcdGet32 (PcdTemporaryRamSize)

/* Reserve region to store handoff data */
li    a4, SEC_HANDOFF_DATA_RESERVE_SIZE
sub   a3, a3, a4

/* Use Temp memory as the stack for calling to C code */
add   sp, a2, a3

call SecStartupPlatform
